<?php $batchSession = ''; ?>
<div id="venue_count<?php echo $venueIndex; ?>_batch_<?php echo $batchIndex; ?>">
    <div class="createBox addmarginB20">
        <div class="batchNum">
            <p class="remmarginB fnt-size18 font-opensansbd">Batch <span class="createdVenueBatchCount create_venue_<?php echo $venueIndex; ?>_batchcounter" id="create_venue_<?php echo $venueIndex; ?>_batch_counter_<?php echo $batchIndex; ?>"><?php echo $batchIndex + 1; ?></span><em class="sprite dw-arrow"></em></p>
        </div>
        <div class="content" style="display: none;">
            <div class="padding20px rempaddingT">
                <div class="height1px dash-borB remmarginB addmarginB20"></div>   
                <div class="formElements">
                    <div class="col-2">
                        <div class="common">
                            <div class="colbatch col1">
                                <div class="dob flatui">
                                    <?php echo $form->labelEx($model, 'start_date'); ?>
                                    <?php if ($batchIndex == 0) { ?><em class="sprite question-sign" title="<?php echo Message::CLASS_BATCH_START_DATE; ?>">&nbsp;</em> <?php } ?>
                                    <div class="clear"></div>
                                    <input type="hidden" name="batchIndex[<?php echo $venueIndex; ?>][]" value="<?php echo $batchIndex; ?>">
                                    <input name="ClassBatch[ClassVenue][<?php echo $venueIndex; ?>][start_date][]" id="class_venue_<?php echo $venueIndex; ?>_classbatch_start_date_<?php echo $batchIndex; ?>" type="text" class="requiredfield hasDatepicker field  small" onblur="checkValueEmpty(this.id)" onkeyup="hasDatepicker(this.id)" onclick="hasDatepicker(this.id)" onpaste="return false;" value="<?php echo $venueWithBatch[$batchIndex]->start_date; ?>">
                                    <div class="errorMessage" id="error_class_venue_<?php echo $venueIndex; ?>_classbatch_start_date_<?php echo $batchIndex; ?>" style="display:none">Start date cannot be blank.</div>
                                </div>
                            </div>

                            <div class="colbatch col2">
                                <div class="timef flatui">
                                    <?php echo $form->labelEx($model, 'start_time'); ?>
                                    <?php if ($batchIndex == 0) { ?><em class="sprite question-sign" title="<?php echo Message::CLASS_BATCH_START_TIME; ?>">&nbsp;</em> <?php } ?>
                                    <div class="clear"></div>
                                    <div class="bootstrap-timepicker">
                                        <input name="ClassBatch[ClassVenue][<?php echo $venueIndex; ?>][start_time][]" id="class_venue_<?php echo $venueIndex; ?>_classbatch_start_time_<?php echo $batchIndex; ?>" type="text" class="requiredfield hastimePicker field small" onpaste="return false;" onkeyup="hastimePicker(this.id);" onclick="hastimePicker(this.id);" onchange="timeCheck(this.id);" value="<?php echo $venueWithBatch[$batchIndex]->start_time; ?>">
                                        <div class="errorMessage" id="error_class_venue_<?php echo $venueIndex; ?>_classbatch_start_time_<?php echo $batchIndex; ?>" style="display:none">Start time cannot be blank.</div></div>
                                </div>
                            </div> 
                            <div class="colbatch col2">
                                <div class="timef flatui">
                                    <?php echo $form->labelEx($model, 'end_time'); ?>
                                    <?php if ($batchIndex == 0) { ?><em class="sprite question-sign" title="<?php echo Message::CLASS_BATCH_END_TIME; ?>">&nbsp;</em> <?php } ?>
                                    <div class="clear"></div>                              
                                    <div class="bootstrap-timepicker">
                                        <input name="ClassBatch[ClassVenue][<?php echo $venueIndex; ?>][end_time][]" id="class_venue_<?php echo $venueIndex; ?>_classbatch_end_time_<?php echo $batchIndex; ?>" type="text" class="hastimePicker requiredfield field small" onpaste="return false;" onkeyup="hastimePicker(this.id);" onclick="hastimePicker(this.id);" onchange="timeCheck(this.id);"  value="<?php echo $venueWithBatch[$batchIndex]->end_time; ?>">
                                        <div class="errorMessage" id="error_class_venue_<?php echo $venueIndex; ?>_classbatch_end_time_<?php echo $batchIndex; ?>" style="display:none">End time cannot be blank.</div>
                                        <div class="errorMessage" id="endTime_class_venue_<?php echo $venueIndex; ?>_classbatch_end_time_<?php echo $batchIndex; ?>"></div></div>
                                </div>
                            </div> 
                            <div class="clear"></div>
                        </div>

                        <div class="common">
                            <div class="col col1">
                                <?php echo $form->labelEx($model, 'price'); ?>
                                <?php if ($batchIndex == 0) { ?><em class="sprite question-sign" title="<?php echo Message::CLASS_BATCH_PRICE; ?>">&nbsp;</em> <?php } ?>
                                <div class="clear"></div>
                                <input name="ClassBatch[ClassVenue][<?php echo $venueIndex; ?>][price][]" id="class_venue_<?php echo $venueIndex; ?>_classbatch_price_<?php echo $batchIndex; ?>" type="text" onkeypress="return isNumberKey(event)" onblur="checkValueEmpty(this.id)" class="requiredfield field" value="<?php echo $venueWithBatch[$batchIndex]->price; ?>">
                                <div class="errorMessage" id="error_class_venue_<?php echo $venueIndex; ?>_classbatch_price_<?php echo $batchIndex; ?>" style="display:none">Price cannot be blank.</div>
                            </div>

                            <div class="col col2">
                                <?php echo $form->labelEx($model, 'seats'); ?> 
                                <?php if ($batchIndex == 0) { ?><em class="sprite question-sign" title="<?php echo Message::CLASS_BATCH_SEATS; ?>">&nbsp;</em> <?php } ?>
                                <div class="clear"></div>
                                <input name="ClassBatch[ClassVenue][<?php echo $venueIndex; ?>][seats][]" id="class_venue_<?php echo $venueIndex; ?>_classbatch_seats_<?php echo $batchIndex; ?>" type="text" onblur="checkValueEmpty(this.id)" onkeypress="return isNumberKey(event)" class="requiredfield field" value="<?php echo $venueWithBatch[$batchIndex]->seats; ?>">
                                <div class="errorMessage" id="error_class_venue_<?php echo $venueIndex; ?>_classbatch_seats_<?php echo $batchIndex; ?>" style="display:none">Seats cannot be blank.</div>
                            </div>                         
                            <div class="clear"></div>
                        </div>


                        <div class="greenBor">
                            <p class="padding20px remmarginB font-opensansbd fnt-size16">Batch Discounts</p>
                            <div class="dash-borB height1px"></div>
                            <div class="padding20px">
                                <?php /* .......................          Here is the early discount code start................ */ ?>

                                <?php
                                $this->renderPartial('/classEarlyDiscount/_form', array('form' => $form, 'batchIndex' => $batchIndex,
                                    'venueIndex' => $venueIndex,
                                    'batchId' => $venueWithBatch[$batchIndex]->id));
                                ?> 


                                <?php /* .......................          Here is the early discount code end................ */ ?>


                                <div class="height1px borB addmarginB30 rempaddingB"></div> 

                                <?php /* .......................          Here is the group discount code start................ */ ?>

                                <?php
                                $this->renderPartial('/groupDiscount/_form', array('form' => $form, 'batchIndex' => $batchIndex,
                                    'venueIndex' => $venueIndex,
                                    'batchId' => $venueWithBatch[$batchIndex]->id));
                                ?> 


                                <?php /* .......................          Here is the group discount code end ................ */ ?>
                                <div class="height1px borB addmarginB30 rempaddingB"></div>



                                <?php /* .......................          Here is the custome session code start................ */ ?>
                                <div class="sm-col-2">    
                                    <div class="common">
                                        <div class="col col1">
                                           <lavel>Add Session</lavel>
                                        <em class="sprite question-sign" title="<?php echo Message::CLASS_BATCH_CUSTOME_SCHEDULE; ?>">&nbsp;</em>
                                            <div class="clear"></div>
                                            <?php echo CHtml::dropDownList('ClassBatch[ClassVenue][' . $venueIndex . '][schedule_id][]', $venueWithBatch[$batchIndex]->schedule_id, getAllSchedule('class'), array('class' => 'getschedule_venue_' . $venueIndex . '_batch_' . $batchIndex . '', 'id' => 'addvenue_' . $venueIndex . '_batch_' . $batchIndex . '_schedule_id_0', 'onchange' => 'addCustomeSchedule(this.id);')); ?>  </div>

                                        <div id="venue_<?php echo $venueIndex; ?>_batch_<?php echo $batchIndex; ?>_schedule">                                            
                                            <?php
                                            $sessionIndex = '';
                                            if ($venueWithBatch[$batchIndex]->schedule_id == 4) {
                                                $batchSession = BatcheSession::model()->findAllByAttributes(array('batche_id' => $venueWithBatch[$batchIndex]->id));
                                                for ($sessionIndex = 0; $sessionIndex < count($batchSession); $sessionIndex++) {
                                                    $this->renderPartial('/batcheSession/_form', array('form' => $form, 'batchIndex' => $batchIndex,
                                                        'venueIndex' => $venueIndex, 'batchSession' => $batchSession, 'sessionIndex' => $sessionIndex));
                                                }
                                            }
                                            ?>                                            
                                        </div>
                                        <div class="showSession_venue_<?php echo $venueIndex; ?>_batch_<?php echo $batchIndex; ?>_schedule" style="clear: both; display: <?php echo ($batchSession == '') ? 'none' : ''; ?>;"><p class="alignL remmarginB"><a href="javascript:void(0)" id="venue_<?php echo $venueIndex; ?>_batch_<?php echo $batchIndex; ?>_schedule_id_<?php echo ($sessionIndex == '') ? '0' : $sessionIndex - 1; ?>" onclick="addCustomeSchedule(this.id);">Add Session <?php if ($batchIndex == 0) { ?><em class="sprite question-sign" title="<?php echo Message::CLASS_BATCH_CUSTOME_SCHEDULE; ?>">&nbsp;</em> <?php } ?></a></p></div>
                                        <div class="clear"></div>
                                    </div>
                                </div> 

                                <?php /* .......................         Here is the custome session code end................ */ ?>
                            </div>
                        </div>   

                        <div class="clear"></div>
                        <?php /* .......................         Here is the class structure code start................ */ ?>
                        <div class="greenBor" style="margin-top: 10px;">
                            <p class="padding20px remmarginB font-opensansbd fnt-size16">Class Structure
                            <?php if ($batchIndex == 0) { ?><em class="sprite question-sign" title="<?php echo Message::CLASSES_STRUCTURE; ?>">&nbsp;</em> <?php } ?>
                            </p>
                            <div class="dash-borB height1px addmarginB20"></div>
                            <?php
                            $class = '';
                            $this->renderPartial('/classStructures/updateClassStructure', array('form' => $form, 'batchIndex' => $batchIndex,
                                'venueIndex' => $venueIndex,
                                'type' => $class,
                                'classId' => $venueWithBatch[$batchIndex]->classes_id,
                                'batchId' => $venueWithBatch[$batchIndex]->id));
                            ?>  
                        </div>
                        <?php /* .......................         Here is the class structure code end................ */ ?>
                    </div>
                    <?php if ($batchIndex != 0) { ?>
                        <p class="alignL padding20px remmarginB">
                            <a href="javascript:void(0)" id="venue_remove_<?php echo $venueIndex; ?>_batch_<?php echo $batchIndex; ?>" onclick="reMoveBatch(this.id);">-Remove Batch</a>
                        </p><?php } ?>
                </div> 
            </div>
        </div>                                
    </div>  </div>  